ResponseMetadata

@Serializable
data class ResponseMetadata(val id: String? = null, val timestampMillis: Long? = null, val modelId: String? = null, val headers: Map<String, String> = emptyMap(), val body: JsonElement? = null) : StreamEvent

Provider response metadata that becomes available after the stream request starts. Mirrors v6's response-metadata stream part so StreamTextResult.response can expose IDs, timestamps, model IDs, headers, and retained response bodies.

Constructors

Link copied to clipboard
constructor(id: String? = null, timestampMillis: Long? = null, modelId: String? = null, headers: Map<String, String> = emptyMap(), body: JsonElement? = null)

Properties

Link copied to clipboard
val body: JsonElement?
Link copied to clipboard
Link copied to clipboard
val id: String?
Link copied to clipboard
val StreamEvent.metadata: Map<String, JsonElement>?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T> StreamEvent.providerMetadataAs(provider: String): T?
fun <T> StreamEvent.providerMetadataAs(provider: String, serializer: KSerializer<T>): T?